package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.springframework.util.ObjectUtils;

import io.wdb.modules.activity.wxapp.entity.HdLotteryActivityEntity;

public class HdLotteryActivityModel implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2132687780010170514L;

	private String lotteryName;
	private String lotteryImg;
	private String lotteryRule;
	private Integer location;
	
	public String getLotteryName() {
		return lotteryName;
	}
	public void setLotteryName(String lotteryName) {
		this.lotteryName = lotteryName;
	}
	public String getLotteryImg() {
		return lotteryImg;
	}
	public void setLotteryImg(String lotteryImg) {
		this.lotteryImg = lotteryImg;
	}
	public String getLotteryRule() {
		return lotteryRule;
	}
	public void setLotteryRule(String lotteryRule) {
		this.lotteryRule = lotteryRule;
	}
	public Integer getLocation() {
		return location;
	}
	public void setLocation(Integer location) {
		this.location = location;
	}
	
	public static HdLotteryActivityModel convert(HdLotteryActivityEntity entity) {
		HdLotteryActivityModel model = new HdLotteryActivityModel();
		if(ObjectUtils.isEmpty(entity)) {
			return model;
		}
		model.setLocation(entity.getLocation());
		model.setLotteryImg(entity.getLotteryImg());
		model.setLotteryName(entity.getLotteryName());
		model.setLotteryRule(entity.getLotteryRule());
		return model;
	}
	public static List<HdLotteryActivityModel> convert(List<HdLotteryActivityEntity> entities) {
		List<HdLotteryActivityModel> models = new ArrayList<HdLotteryActivityModel>();
		if(ObjectUtils.isEmpty(entities) || entities.size() == 0) {
			return models;
		}
		
		for(HdLotteryActivityEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}

}
